#include <iostream>
#include <map>
#include <string>
#include <vector>

using namespace std;

class A
{
private:
    vector<int> data1;
    vector<int> data2{1,2,3,4,5,6};         //类成员列表初始化（类内初始化）
    vector<int> data3 = {1,2,3,4,5,6};      //类成员列表初始化（类内初始化）(使用等号)
public:
    A(vector<int>,int) : data1{1,2,3,4,5,6}{}              //类成员列表初始化（构造函数初始化）
    bool operator [] (vector<int>){}
    A& operator = (vector<int>)
    {
        return *this;
    }
};

vector<int> func(vector<int> t)
{
    return {1,2,3,4,5,6};                  // 使用列表初始化构造返回值
}

int main()
{
    vector<int> a {1,2,3,4,5,6,7};          //初始化具名变量
    auto b = vector<int>{1,2,3,4,5,6,7};    //初始化临时变量
    auto c = new vector<int>{1,2,3,4,5,6,7};//动态分配初始化
    delete c;

    vector<int> d = {1,2,3,4,5,6,7};        //使用赋值运算符进行列表初始化
    func({1,2,3,4,5,6,7});                  //参数传递，使用列表初始化构造参数

    A e {{1,2,3,4,5,6},5};                  //生成构造函数的参数
    e = {2,3,4,5,6,7};                      //生成operator = 的参数
    e[{1,2,3,4,5,6}];                       //列表初始化构造下标

}